package yagwl.client.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Hyperlink;

/**
 * Menu nodes
 */
@SuppressWarnings("serial")
public class MenuNodeDTO implements Serializable {

  private MenuNodeDTO parent;
  private List<MenuNodeDTO> children;
  private Hyperlink hyperlink;
  private Anchor anchor;
  
  public MenuNodeDTO(Hyperlink hyperlink) {
    this.hyperlink = hyperlink;
  }
  
  public MenuNodeDTO(Anchor anchor) {
    this.anchor = anchor;
  }
  
  public Hyperlink getHyperlink() {
    return hyperlink;
  }

  public Anchor getAnchor() {
    return anchor;
  }

  public MenuNodeDTO getParent() {
    return parent;
  }

  public void addChild(MenuNodeDTO menuNode) {
    if (children == null)
      children = new ArrayList<MenuNodeDTO>();
    children.add(menuNode);
  }

  public void setChildren(List<MenuNodeDTO> children) {
    this.children = children;
  }

  public List<MenuNodeDTO> getChildren() {
    return children;
  }

}
